package com.atguigu.a_arrayinarray;

public class Demo1 {
    public static void main(String[] args) {
        String[][] names = {{"张三","李四","王五"},{"赵六","田七"},{"朱八"}};

        //遍历第一个一维数组 -> names[0]
        for (int i = 0; i < names[0].length; i++) {
            System.out.println(names[0][i]);
        }

        //遍历第二个一维数组 -> names[1]
        for (int i = 0; i < names[1].length; i++) {
            System.out.println(names[1][i]);
        }
        System.out.println("-------------------------------");
        for (int j = 0; j < names.length; j++) {
            for (int i = 0; i < names[j].length; i++) {
                System.out.println(names[j][i]);
            }
        }


    }
}
